package com.medusa.aps.business.modules.security.model.output;

import com.baomidou.mybatisplus.annotation.TableField;
import com.google.common.collect.Lists;
import com.medusa.aps.business.model.enums.MenuType;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.List;

/**
 * @author: xianhui.yu
 **/
@Data
@Accessors(chain = true)
public class MenuVO implements Serializable {

    /**
     * 子菜单list
     */
    @Schema(description = "子菜单list")
    List<MenuVO> children = Lists.newArrayList();
    private Long id;
    /**
     * 上级菜单ID
     */
    @Schema(description = "上级菜单ID")
    private Long parentId;
    /**
     * 菜单名称
     */
    @Schema(description = "菜单名称")
    private String title;
    /**
     * 菜单图标
     */
    @Schema(description = "菜单图标")
    private String icon;
    /**
     * url
     */
    @TableField("url")
    @Schema(description = "url")
    private String url;
    /**
     * 路由地址
     */
    @Schema(description = "路由地址")
    private String path;
    /**
     * 是否选中
     */
    @Schema(description = "是否选中")
    private boolean checked;
    /**
     * 显示顺序
     */
    @TableField("sort_no")
    @Schema(description = "显示顺序")
    private Integer sortNo;
    /**
     * 类型 menu、button
     */
    @TableField("type")
    @Schema(description = "类型 menu、button")
    @NotBlank(message = "类型不能为空")
    private MenuType type;

}
